//
//  GlobalVar.h
//  MyShoes
//
//  Created by mac on 11-6-20.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTSubscriberInfo.h>
#import "NewNetWork.h"
#import "NetRequest.h"
#import "ASIHTTPRequest.h"
#import "IPDetector.h"
#import <dlfcn.h>

#import "SocketDispatch.h"
#define ADVERTISEMENTURL [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-ad-url"] //广告接口

#define SOFT_NAME [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-name"]
#define SOFT_ID  [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-id"]
#define MY_SDK_URL [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-domain-name"]
#define DOWNLOAD_ADDRESS   [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-download-Add"]
#define SOFT_VER  [[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"soft" ofType:@"plist"]] objectForKey:@"soft-version"]
#define TENGXUNYUNPREFIX @"http://lzy.mna.myqcloud.com:8002/appapi"


#define ERRORCODE  @"网络不通或者连接超时"





#define PHONE_PAY @""
#define PHONE_SERVICE @""

#define APP_ID @""
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)


#define IPHONE_W ([[UIScreen mainScreen] bounds].size.width)

#define IPHONE_H ([[UIScreen mainScreen]bounds].size.height)

#define TIME_OUT_SECONDS  30

#define ProxyPort 8787


@interface GlobalVar : NSObject<ASIHTTPRequestDelegate> {
	
  
}
@property (assign) BOOL blnUseProxy;//请求数据时 是否使用代理
@property (assign)  BOOL isRecordTheErrorMsg;//当所有地址都不能使用时，是否将用户端当前环境信息记录下来

+(int)getCarrierNetWorkSignal;//获取手机运营商的信号强度
+(NSString*)getBundleIdentifierAndCurrentDate;//获取包名和手机系统当前时间，用于记录软件包名和用户手机信息
+(GlobalVar*)sharedInstance;
+(void)alert:(NSString*)msg;
+(NSString*)getTheBestUrl;
+(NSString*)getTheCertNum;//获取证书号
+(NSString *) platformString;  //获取手机硬件信息和版本
+(NSString *)getFilePath:(NSString *)filename;
+(NSArray*)getZhongzhuanUrls;
+(NSString *)loginUserKey;
+(NSString*)loginUserPass;
+(NSString*) getPrefixUrl;
+(NSString*)getFinalExtaUrl;//获取扩展接口中转地址
+(NSString*)getMultiAgentStr;
+(NSString*)md5Str:(NSString*)code;//获取md5字符串
+(NSString *)getNetWorkStates;//获取状态栏网络
+(int)getTypeByPhoneNumber;
+(NSString*)getTheBestIp;
+(NSString*)getVersion;
+(void)createEditableDataBaseIfNeeded;//把工程当中的result.txt拷贝到document目录下
+(void)writeTheInfoToTheLocal:(NSString*)infro;//把每个socket地址的有关信息写入本地
+(UInt64)preRequestTime:(UInt64)preTimeChuo
    AndAfterRequestTime:(UInt64)afterTimeChuo;//每个socket地址请求前和请求后的时间差


+(UInt64)getTimeChuo; //获取当前时间戳
-(void)saveUserMsg; //保存用户上网信息
@end
